﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AutoPartsSearch.Domain.Abstract.Repositories;

namespace AutoPartsSearch.Web.Areas.Administration.Controllers
{
    public class ContactsController : Controller
    {
        private readonly IContactRepository _contactRepository;

        public ContactsController(IContactRepository contactRepository)
        {
            _contactRepository = contactRepository;
        }

        public ActionResult Index()
        {
            var result = _contactRepository.Get();
            return View(result);
        }

        public ActionResult Details(int id)
        {
            var contact = _contactRepository.GetById(id);
            return View(contact);
        }

    }
}
